package com.example.managesystem.mapper;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface DelayItemMapper {


    /**
     * 提交延期结项申请
     * @param itemId
     * @param reason
     */
    @Insert("insert into delay_failure (item_id, reason_text) values (#{itemId},#{reason})")
    void insertDelayItem(@Param("itemId") Integer itemId, @Param("reason") String reason);

    /**
     * 查看延期申请原因
     * @param itemId
     * @return
     */
    @Select("select reason_text from delay_failure where item_id=#{itemId}")
    String LookSubmitDelayReason(@Param("itemId")Integer itemId);

    /**
     * 延期申请失败
     * @param itemId
     * @param failReason
     */
    @Insert("insert into delay_failure(item_id,failure_text) values(#{itemId},#{failReason})")
    void insertDelayFailItem(@Param("itemId")Integer itemId, @Param("failReason")String failReason);
}
